<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head  th:include="/common/base :: base"></head>
<span>
		<link rel="stylesheet"  th:href="@{/css/pccs/type_list.css}"/>
		<script type="text/javascript" th:src="@{/js/pcjs/pageNavigation.js}"></script>
	</span>

<script th:inline="javascript">
    //定义全局变量
    var counts = /*[[${counts}]]*/ "counts";
    var url =/*[[@{/admin/type/typeListUI}]]*/ "url" ;//文件以静态的方式打开则 值为第二个值
    var pCur = /*[[${pCur}]]*/ "pCur";
    var pSize = /*[[${pSize}]]*/ "pSize";

    console.log("pCur"+pCur);
    console.log("pSize"+pSize);

    //用户搜索
    function Search(){
        document.forms[0].action=url;
        console.log(url);
        document.forms[0].submit();
    }
</script>
<body>
<nav class="navbar navbar-default" role="navigation">
	<div class="container-fluid">
		<div class="navbar-header">
			<a class="navbar-brand" href="#">搜索栏</a>
		</div>
		<form class="navbar-form navbar-left" role="search">
			<div class="form-group">
				<button type="button" class="btn btn-default">类型名:</button>
				<input type="text" name ="typeName" th:value="${typeName}" class="form-control" placeholder="Search">
			</div>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<div class="form-group">
				<button type="button" class="btn btn-default">父类型:</button>
				<select class="form-control" name="parentId">
					<option value="-1">——选信息类型——</option>
					<option th:each="typeP : ${typePList}"
							th:value="${typeP.typeId}"
							th:text="${typeP.typeName}"
							th:if="${parentId eq typeP.typeId }"
							th:attr="selected=true"
					></option>
					<option th:each="typeP : ${typePList}"
							th:value="${typeP.typeId}"
							th:text="${typeP.typeName}"
							th:if="${parentId ne typeP.typeId }"
					></option>
				</select>
			</div>
			<input type="hidden" name="pCur" value="1" id="pCurId">
			&nbsp;&nbsp;
			<button type="button"  onclick="Search()" class="btn btn-primary">搜索</button>
		</form>
	</div>
</nav>
<div class="panel panel-default" style="margin-top: -10px;">
	<div class="panel-heading">
		<h3 class="panel-title">
			用户列表
		</h3>
	</div>
	<div class="panel-body">
		<div class="layui-form layui-border-box layui-table-view" lay-filter="LAY-table-1" style="margin: 0 auto;width: 750px;">
			<div class="layui-table-box">
				<div class="layui-table-header">
					<table cellspacing="0" cellpadding="0" border="0" class="layui-table">
						<thead>
						<tr>
							<th data-field="ID">
								<div class="layui-table-cell laytable-cell-1-ID">
									<span>ID</span>
								</div>
							</th>
							<th data-field="typeName">
								<div class="layui-table-cell laytable-cell-1-typeName">
									<span>类型名称</span>
								</div>
							</th>
							<th data-field="handle">
								<div class="layui-table-cell laytable-cell-1-handle"><span>操作</span></div>
							</th>
						</tr>
						</thead>
					</table>
				</div>
				<div class="layui-table-body layui-table-main">
					<table cellspacing="0" cellpadding="0" border="0" class="layui-table">
						<tbody>
						<tr th:each="type,itemstart : ${typeList}">
							<td data-field="ID">
								<div class="layui-table-cell laytable-cell-1-ID"
								th:text="${itemstart.index+1}"
								></div>
							</td>
							<td data-field="content">
								<div class="layui-table-cell laytable-cell-1-typeName"
									th:text="${type.typeName}"
								></div>
							</td>
							<td data-field="handle" align="center" data-off="true">
								<div class="layui-table-cell laytable-cell-1-3">
									&nbsp;&nbsp;
									<!--如果有多个参数则 则用逗号隔开,-->
									<a class="layui-btn layui-btn-primary layui-btn-xs"
									   th:href="@{/admin/type/descUI(typeId=${type.typeId})}"
									  >查看</a>
									&nbsp;&nbsp;
									<a class="layui-btn layui-btn-xs"
									   th:href="@{/admin/type/editUI(typeId=${type.typeId})}"
									>编辑</a>
									&nbsp;&nbsp;
									<a class="layui-btn layui-btn-danger layui-btn-xs"
										th:href="@{/admin/type/delete/(typeId=${type.typeId})}"
									   onclick="return confirm('你真的要删除吗？')"
									>删除</a>
								</div>
							</td>
						</tr>
						</tbody>
					</table>
				</div>
				<div id="fenye" style="width: 750px;"></div>
			</div>
		</div>
	</div>
</div>
</body>

</html>